package cc.risingsun.wing.dai.entity;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import cc.risingsun.wing.ds.DataStruct;

/**
 *
 *@author iron.yin@gmail.com
 *@since  2012-6-21
 */
public abstract class WingEntityBean implements Cloneable{
	
	protected static final Map<Class<?>, Object> primitiveDefaults = new HashMap<Class<?>, Object>();

    static {
        primitiveDefaults.put(Integer.TYPE, Integer.valueOf(0));
        primitiveDefaults.put(Short.TYPE, Short.valueOf((short) 0));
        primitiveDefaults.put(Byte.TYPE, Byte.valueOf((byte) 0));
        primitiveDefaults.put(Float.TYPE, Float.valueOf(0f));
        primitiveDefaults.put(Double.TYPE, Double.valueOf(0d));
        primitiveDefaults.put(Long.TYPE, Long.valueOf(0L));
        primitiveDefaults.put(Boolean.TYPE, Boolean.FALSE);
        primitiveDefaults.put(Character.TYPE, Character.valueOf((char) 0));
    }

	protected String originalClass;
	
	protected Set<String> fieldsName;
	
	public WingEntityBean(){
		fieldsName = DataStruct.hashSet();
	}

	public Set<String> getFields(){
		return fieldsName;
	}
	
	@Override
	protected Object clone() throws CloneNotSupportedException {
		return super.clone();
	}
	public abstract void setValue(String fieldName,Object value);
}
